Documentation for class control

Inherits from 	gadget 

Properties declared in control 
	action 
	is_enabled 
	target 

Class Methods declared in control 
	new 

Methods declared in control 
	any 
		action 
		do_action 
		is_enabled 
		mouse_down 
		mouse_dragged 
		mouse_up 
		set_action(message_name) 
		set_is_enabled(boolean) 
		set_target(object) 
		target 
	events 
		do_action
		mouse_down 
		mouse_dragged 
		mouse_up 
	get 
		action 
		is_enabled 
		target 
	set 
		set_action(message_name) 
		set_is_enabled(boolean) 
		set_target(object) 

Class 
#begin_class
control 
The class control is a sub-class of the class gadget. 
The class control is a so-called abstract class. It implements the methods that is shared by all the different controllers. 
Note: You cannot create instances of an abstract class.
Controllers are gadgets that are used for user input. Examples of controllers are button, slider, text-field, matrix and color-well.
When the user interacts with a controller the system sends a do_action message to the controller. 
The default behavior of the do_action method in a controller is to send the message stored in the action property to the object referenced by the target property. You may override the default do_action to get the desired behavior.
#end_class

Properties 

#begin_property
action 
Stores the name of the action message that is used by the default implementation of the do_action method. The action message is sent to the object specified by the target property. 
See the do_action method description for details.
#end_property

#begin_property
is_enabled 
Stores a boolean value. If it is true the controller will be enabled and react to user interaction. If it is false the controller will be disabled and not react to user interaction.
#end_property

#begin_property
target 
Stores the reference to an object that receives the action message specified by the action property. When the object receives a do_action message it sends the action message to the target. 
See the do_action method description for details.
#end_property

Methods 

#begin_method
action 
Returns the action property of the controller.
#end_method

#begin_method
do_action 
When the user interacts with a controller the system sends a do_action message to the controller. 
The default behavior of the do_action method in a controller is to send the message stored in the action property to the object referenced by the target property.
Returns self.
Comment: Usually you just set the action and target properties to specify the behavior of a controller. 
You may override the default do_action behavior to get a specific behavior.
Note: If you want the action message to be sent to the target even when you override the do_action method, make sure the last line in your new do_action method is:
return super:do_action 
#end_method

#begin_method
is_enabled 
Returns the is_enabled property of the controller.
#end_method

#begin_method
mouse_down 
The message mouse_down is never sent to control objects. The message do_action is sent instead.
Returns self. 
Also see do_action.
#end_method

#begin_method
mouse_dragged 
The message mouse_dragged is never sent to control objects. The message do_action is sent instead.
Returns self. 
Also see do_action.
#end_method

#begin_method
mouse_up 
The message mouse_up is never sent to control objects. The message do_action is sent instead.
Returns self. 
Also see do_action.
#end_method

#begin_method
set_action(message_name) 
Sets the action property to the symbol message_name. 
Returns self.
#end_method

#begin_method
set_is_enabled(boolean) 
Sets the is_enabled property to boolean. 
Returns self.
#end_method

#begin_method
set_target(object) 
Sets the target property to object. 
Returns self.
#end_method

#begin_method
target 
Returns the target property of the controller.
#end_method

Class Methods 

#begin_class_method
new 
You cannot create instances of the class control since it is an abstract class.
Ex:
{control}:new
raises an exception
Exception:
The message new was sent to the class control but control is an abstract class which you can't make instances of
#end_class_method